package moreHealthControl;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;


//Stores the prediction result for an individual Location-Pair from the Student journey. 
public class PatternFoundArrayList {

	//ATTRIBUTES ======================================
	ArrayList<String> testStringListx_;
	String loc1x_;
	String loc2x_;
	
	
	String formattedStringList="";
	
	
	//CONSTRUCTOR ======================================
	//INTENT:	Stores prediction Information for a Student based on every Location-Pair in the Student Journey. 
	//PRE-CONDITION	:
	//1.	Location1 (loc1) and Location2 (loc2) should be integer. 
	//2.	There should be at least one element in the listString. 
	//3.	The location1 (loc1) and location2 (loc2) should be within the grid dimension.
	//POST-CONDITION:
	public PatternFoundArrayList (ArrayList<String> listString, String loc1, String loc2){
		testStringListx_ = listString;
		this.loc1x_ = loc1;
		this.loc2x_= loc2;
	}
	
	//Return the Pattern based on the current Location-Pair values. 
	public ArrayList<String> getListString (){
		return testStringListx_;
	}
	
	//First Student Location 
	public String getLoc1(){
		return loc1x_;
	}
	
	//Second Student Location
	public String getLoc2(){
		return loc2x_;
	}
	
	//INTENT:	Creates a formatted string from the Prediction location in the Array list. 
	//PRE-CONDITION	:
	//1.	There should be at least one element in the listString. 
	//POST-CONDITION:
	//1.	Return the prediction result array list as a space- delimited formatted string. 
	public String getFormattedStringList(){
		
		Enumeration<String> listIt= Collections.enumeration(testStringListx_);
		
		while(listIt.hasMoreElements()){
		String 	currentStringList= (String) listIt.nextElement();
		formattedStringList= formattedStringList + currentStringList +" ";
		}
		
		return formattedStringList;
		
	}
}
